?><?
class cls_class_element extends cls_entity{
  var $id;
  var $name;
  var $parent_id;
  var $description;
  var $attributes;
  var $accept;
  var $all;
  function entity(){return "class";}

  function cls_class_element(&$array){
    $this->accept     = array();
    $this->id         = $array["class_id"];
    $this->parent_id  = $array["class_parent_id"];
    $this->name       = $array["class_name"];
    $this->description= $array["class_description"];
  }
  function asXML(){
    $xml ="<class id=\"$this->id\" parent_id=\"$this->parent_id\" name=\"$this->name\">";
    $xml.="<description>";
    $xml.="<![CDATA[$this->description]]>";
    $xml.="</description>";
    $xml.="<attributes>";
    foreach($this->items as $attribute) $xml.=$attribute->asXML();
    $xml.="</attributes>";
    $xml.="<accepts>";
    foreach($this->accept as $accept) $xml.="<accept id=\"$accept->id\"/>";
    $xml.="</accepts>";
    $xml.="</class>";
    return $xml;
  }
}
